//
//  LSZNewVideoPlayerTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/9/6.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZNewVideoPlayerTableViewCell.h"

@implementation LSZNewVideoPlayerTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.labelNumber = [[UILabel alloc]init];
        self.labelNumber.textColor = titleColorLSZ;
        self.labelNumber.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.labelNumber];

        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.textColor = titleColorLSZ;
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelTitle];
        [self addSubview:self.labelTitle];

        self.labelAlbum = [[UILabel alloc]init];
        self.labelAlbum.textColor = lightColor;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelAlbum font:13];
        [self addSubview:self.labelAlbum];

        self.imageViewHeadset = [[UIImageView alloc]init];
        self.imageViewHeadset.image = [UIImage imageNamed:@"播放三角"];
        [self addSubview:self.imageViewHeadset];

        self.labelPlayNumber = [[UILabel alloc]init];
        self.labelPlayNumber.textColor = lightColor;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelPlayNumber font:13];
        [self addSubview:self.labelPlayNumber];

        self.labelTime = [[UILabel alloc]init];
        self.labelTime.textColor = lightColor;
        self.labelTime.textAlignment = NSTextAlignmentRight;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelTime font:13.5];
        [self addSubview:self.labelTime];

        CGFloat height = [LSZSpecialPackaging initWithReturnsthesizeOf:60 :5];
        CGFloat heightLabel = [LSZSpecialPackaging initWithReturnsthesizeOf:18 :2];

        self.labelNumber.frame = CGRectMake(0,10, 50, height-20);
        self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.labelNumber.frame), 8,ScreenWidth-CGRectGetMaxX(self.labelNumber.frame)-60, heightLabel);
        self.labelAlbum.frame = CGRectMake(CGRectGetMaxX(self.labelNumber.frame), CGRectGetMaxY(self.labelTitle.frame)+5,  ScreenWidth-CGRectGetMaxX(self.labelNumber.frame)-60, heightLabel);
        self.imageViewHeadset.frame = CGRectMake(CGRectGetMaxX(self.labelAlbum.frame), CGRectGetMaxY(self.labelTitle.frame)+3,heightLabel,heightLabel);
        self.labelPlayNumber.frame = CGRectMake(CGRectGetMaxX(self.imageViewHeadset.frame)+2, CGRectGetMaxY(self.labelTitle.frame)+3, ScreenWidth-CGRectGetMaxX(self.imageViewHeadset.frame)-2, heightLabel);
        self.labelTime.frame = CGRectMake(ScreenWidth-50-10, 10, 50, height-20);

    }
    return self;
}
-(void)setIsOrPlayer:(BOOL)isOrPlayer
{
    if (isOrPlayer == YES) {
        self.labelNumber.textColor = redUIColor;
        self.labelTitle.textColor = redUIColor;
        self.labelPlayNumber.textColor = redUIColor;
        self.labelTime.textColor = redUIColor;
        self.labelAlbum.textColor = redUIColor;
        self.imageViewHeadset.image = [UIImage imageNamed:@"播放三角_红色"];
    }else{
        self.labelNumber.textColor = lightColor;
        self.labelTitle.textColor = titleColorLSZ;
        self.labelAlbum.textColor = lightColor;
        self.labelPlayNumber.textColor = [UIColor colorWithRed:200/255.0 green:200/255.0 blue:200/255.0 alpha:1];
        self.labelTime.textColor = titleColorLSZ;
        self.imageViewHeadset.image = [UIImage imageNamed:@"播放三角"];
    }
}
-(void)setManager:(LSZListOfMVTypesMg *)manager
{
    self.labelTitle.text = manager.name;
    self.labelTime.text = manager.play_time;
}
@end
